<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>    
<%
	String path = request.getContextPath();
	String url_path = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	request.setAttribute("url_path", url_path);
 %>
 <div class="l right ifSelected"> 
	<a  class="first"  href="${ctx}/">首页</a>
	<a  href="${ctx}/goods/newProducts">新品推荐</a>
	<a  href="${ctx}/goods/productCenter">产品中心</a>
	<a  href="${ctx}/goods/hotSale">热销产品</a>
	<a  href="${ctx}/goods/specialPro">特价产品</a>
	<a  href="${ctx}/aboutCompany/initStoreTrends">商城动态</a>
	<a  href="${ctx}/aboutCompany/initAboutCompany">关于我们</a>
 </div> 

<script type="text/javascript">
	/* $("div.ifSelected a").click(function(){
	//	$(this).css("background-color","yellow");
		$(this).prop("class","selected");
	}); */
	 $(document).ready(function () {
	 		//首次在首页添加样式
	 	//	$("#home").prop("class","selected");
          $('div.ifSelected a').each(function () {
         //   $('.ifSelected a').each(function () {
            	var url = $($(this))[0].href;
            	var style = $($(this)).attr('class');
            	if(style!='first') {
            		if ($($(this))[0].href == String(window.location))
                		$(this).prop("class","selected");
            	}
                  //  $(this).addClass(" selected first");
                  //  $(this).addClass('currentA').attr('href', 'javascript:void(0);');
            });
        })
</script>
